#include "setting.h"
#include "ui_setting.h"
#include <QDebug>

Setting::Setting(QWidget *parent,QString cfgString,QString weightString,QString nameString,double confidence)
    : QDialog(parent)
    , ui(new Ui::Setting)
{
    setAttribute(Qt::WA_DeleteOnClose);
    ui->setupUi(this);
//    ui->confidenceSlider->setValue(50);
    connect(ui->exitButton,&QPushButton::clicked,[=](){
        this->close();
    });
    connect(ui->confidenceSlider,&QSlider::valueChanged,[=](){
        ui->confidenceSpinBox->setValue(double(ui->confidenceSlider->value())/100);
    });
    connect(ui->confidenceSpinBox,QOverload<double>::of(&QDoubleSpinBox::valueChanged),[=](double d){
        ui->confidenceSlider->setValue(d*100);
    });
    ui->cfgStringLine->setText(cfgString);
    ui->weightsStringLine->setText(weightString);
    ui->namesStringLine->setText(nameString);
}

Setting::~Setting()
{
    delete ui;
}

